package com.train.dubbo.consumer.controller;

import com.train.dubbo.provider.api.EchoService;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class EchoController {

    @DubboReference(version = "1.0.0")
    private EchoService echoService;

    @GetMapping("/echo/{name}")
    public String echo(@PathVariable String name){
        return echoService.echo(name);
    }
}

